<template>
  <div class="part-left">
    <div class="top">
      <div class="peoplenum">
        <div class="d_card">
          <div class="label">当前客流</div>
          <div class="num din">{{ data.curnum + 35 }}<span>人</span></div>
        </div>
        <div class="d_card">
          <div class="label">今日累计客流</div>
          <div class="num din">{{ data.allenter + 150 || "- -" }}<span>人</span></div>
        </div>
      </div>
      <div class="chart-area">
        <div class="d_card chart">
          <div class="label">实时客流趋势</div>
          <chart-flow :data="data.trend"></chart-flow>
        </div>
        <div class="d_card qrcode">
          <img src="../../../assets/qrcode.jpg" />
          <div class="name">场馆小程序</div>
        </div>
      </div>
    </div>
    <div class="bottom">
      <div class="d_card">
        <div class="label">场馆服务信息</div>
        <s-table></s-table>
      </div>
    </div>
  </div>
</template>

<script>
import chartFlow from "../../components/flow.vue";
import sTable from "../../components/table.vue";

let timer;

export default {
  components: { chartFlow, sTable },
  props: {
    data: {
      type: Object,
      default() {
        return {
          curnum: 0
        };
      }
    }
  },
  data() {
    return {
      count: 68,
      total_count: 197,
      time: new Date(this.$route.query.t).valueOf()
    };
  },
  beforeDestroy() {
    clearInterval(timer);
  },
  mounted() {},
  methods: {}
};
</script>

<style lang="scss" scoped>
.top {
  width: 100%;
  .peoplenum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .d_card {
      width: 233px;
      height: 130px;
      padding: 16px 24px;
      .label {
        font-size: 18px;
        color: #ff8a18;
        margin-bottom: 20px;
      }
      .num {
        font-size: 56px;
        span {
          display: inline-block;
          margin-left: 6px;
          font-size: 20px;
        }
      }
    }
  }
  .chart-area {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .d_card {
      padding: 16px 12px;
      .label {
        padding: 0 12px;
        font-size: 18px;
        color: #ff8a18;
        margin-bottom: 4px;
      }
    }
    .chart {
      width: 312px;
      height: 196px;
    }
    .qrcode {
      width: 153px;
      height: 196px;
      padding: 20px 15px;
      img {
        width: 100%;
      }
      .name {
        font-size: 16px;
        text-align: center;
        margin-top: 14px;
      }
    }
  }
}
.bottom {
  margin-top: 30px;
  .d_card {
    width: 100%;
    height: 544px;
    padding: 20px 24px;
    .label {
      font-size: 18px;
      color: #ff8a18;
      margin-bottom: 20px;
    }
  }
}
</style>
